<?php

 class StringUtil{
 	
 	private $token;
 	
 	public function StringUtil(){
 		$this->setToken("-");
 	}
 	
 	
 	
 	public static function stringTokenizer($string){
 		$token = "-";
 		$stringList = array();
 		$stringAux = "";
 		$stringSize = strlen($string);	
 		echo "<br> tamanho = " . $stringSize . "<br>";
 		if($string != ""){
 			$posicaoAtual = 0;
 			
 			$teste = explode('-', $string);
 			
 			echo "<br>"; 
 			
 			print_r($teste);
 			
 			echo "<br>"; 

 			for($posicaoAtual = 0; $posicaoAtual < $stringSize; $posicaoAtual++){
//mb_substr($string, $posicaoAtual, 1)
 				while($string[$posicaoAtual] != $token && $posicaoAtual < $stringSize){
 					echo "<br> Caractere = " . $string[$posicaoAtual] . "<br>";
 					$stringAux = $stringAux . $string[$posicaoAtual];
 					echo "<br> valor = " . $string . "<br>";
 					$posicaoAtual++;
 				}
 				$stringList[] = trim($stringAux);
 			}
 		}
 		print_r($stringList);	
 		return $stringList;
 	}
 	
 	public function setToken($token){
 		$this->token = $token;
 	}
 	
 	public function getToken(){
 		return $this->token;
 	}
	
}

?>